<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title>配送地址</title>
	<link rel="stylesheet" type="text/css" href="./Public/Home/css/address.css"/>
	<script src="./Public/Home/js/jquery.min1.9.js" type="text/javascript" charset="utf-8"></script>
	<script src="./Public/Home/js/index.js" type="text/javascript" charset="utf-8"></script>
	<script src="./Public/Home/js/area.js" type="text/javascript" charset="utf-8"></script>
	<link rel="stylesheet" href="./Public/Home/css/sanji.css">
	<script>
		$(function () {
            $('.button-light').click(function () {
                $(this).siblings('.g').show();
            })
            $('.save').click(function () {
                $(this).parents('.g').hide();
            })
        })
	</script>
    <script>
        $(function () {
            $('.save').click(function () {
                //表单序列化
                var data=$('.g').serialize();
                data=decodeURIComponent(data,true);
//                alert(data);
                $.ajax({
                        type:'post',
                        url:'<?php echo U('Address/add')?>',
                    data:data,
                    dataType:'json',
                    success:function(phpData){
//                    alert(phpData);
                    var html = '<li style="height: 44px; margin-left: 33px;"><input type="radio" name="addressid" value="'+phpData.aid+'">';
                    html+='&nbsp;&nbsp;&nbsp;&nbsp;'+phpData.aname
                    html+='&nbsp;&nbsp;&nbsp;&nbsp;'+phpData.aphone;
                    html+='&nbsp;&nbsp;&nbsp;&nbsp;'+phpData.aaddress;
                    html+='&nbsp;&nbsp;&nbsp;&nbsp;'+phpData.amail;
                    html+=' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+'<a href="">删除</a>'+'</li>';
//						alert(html);
                    $('#address ul').append(html);

                }
                 })
            })
        })
    </script>

</head>
<body>
	<!--头部条开始-->
			
	<!--头部条开始-->
	<div id="header">
		<div class="center">
			<!--左部分开始-->
			<ul class="left">
				<li class="gi1">
					<a href="javascript:;">社区</a>
				</li>
				<li class="gi2">
					<a href="javascript:;">ColorOS</a>
				</li>
				<li class="gi3">
					<a href="javascript:;">软件商店</a>
				</li>
				<li class="gi4">
					<a href="javascript:;">手机助手</a>
				</li>
				<li class="gi5">
					<a href="javascript:;">云服务</a>
				</li>
			</ul>
			<!--左部分结束-->
			
			<!--右部分开始-->
			<ul class="right">
				<li class="gi1">
                                    
					    <a href="http://localhost/opposhop/index.php?m=Home&c=User&a=index">nihao</a>
                    				</li>
				<li class="gi2">
                                    
                    <a href="http://localhost/opposhop/index.php?m=Home&c=Login&a=out">退出</a>
                    				</li>
				
			</ul>
		</div>
	</div>
	<!--头部条结束-->
	
	<!--导航区域开始-->
	<div id="dh">
		<div id="wrapper">
		<div id="logo">
			<img src="./Public/Home/images/oppo_logo.png"/>
		</div>
		<div class="shop">

			<span class="text"><a href="http://localhost/opposhop/index.php?m=Home&c=Cart&a=index">购物车</a></span>
			<span class="icon"></span>
			<span class="num"> 
				<span class="shop-count">
					0
				</span>
			</span>
		</div>
		<ul class="nav">
				<li class="gi1">
					<a href="index.php"  >首页</a>
				</li>
							<li class="gi2" >
					<a href="http://localhost/opposhop/index.php?m=Home&c=List&a=index&cid=1" >手机</a>
				</li>
				</div>
	</div>
	
	<!--内容开始-->
	<div class="main-content-user">
		<div class="wrapper">
			<ul class="breadcrumb">
				<li>
					<a href="">首页</a>
					<span>/</span>
				</li>
				<li>
					配送地址
				</li>
			</ul>
			<div class="myOppo-menu">
				<h2 class="h-gamma">配送地址</h2>
				<ul class="navigation">
					
					<li >
						<a  href="<?php echo U('User/index')?>">账户信息</a>
					</li >
					<li class="active">
						<a href="<?php echo U('User/add')?>">配送地址</a>
					</li>
					<li>
						<a href="<?php echo U('User/form')?>">我的订单</a>
					</li>	
				</ul>
			</div>

			<div class="brick-shadow">
                <div id="address">
                    <ul>
                        <?php foreach ($addressData as $v){?>
                        <li style="height: 44px; margin-left: 33px"><input type="radio" name="addressid" value="<?php echo $v['aid']?>">&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $v['aname']?>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $v['aphone']?>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $v['aaddress']?>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $v['amail']?>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="<?php echo U('User/del',array('aid'=>$v['aid']))?>">
                                删除
                            </a></li>
                        <?php }?>
                    </ul>
                </div>
                <a class="button-light" href="javascript:;"style="display:block;width: 88px;height: 20px;">添加新地址</a>
                <form action="" method="post" class="g"style="display: none">
                    <div class="address-create" >
                    <div class="con">
                        <label>*收货人姓名</label>
                        <input type="text" name="aname" id="" class="uname" value="" />
                    </div>

                    <div class="tel">
                        <label>*手机号码</label>
                        <input type="text" name="aphone" class="phone"/>
                    </div>
                    <div class="address">
                        <label>*收货地址</label>

                        <div class="info">
                            <div>
                                <select id="s_province" name="aaddress[]" ></select>  
                                <select id="s_city" name="aaddress[]" ></select>  
                                <select id="s_county" name="aaddress[]"></select>
                                <script class="resources library" src="area.js" type="text/javascript"></script>

                                <script type="text/javascript">_init_area();</script>
                            </div>
                            <div id="show"></div>
                        </div>
                        <script type="text/javascript">
                            var Gid  = document.getElementById ;
                            var showArea = function(){
                                Gid('show').innerHTML = "<h3>省" + Gid('s_province').value + " - 市" +
                                    Gid('s_city').value + " - 县/区" +
                                    Gid('s_county').value + "</h3>"
                            }
                            Gid('s_county').setAttribute('onchange','showArea()');
                        </script>
                        <input type="text" name="address-detail" class="address-detail" placeholder="详细街道地址"/>

                    </div>

                    <div class="emal">
                        <label>邮箱</label>
                        <input type="text" name="amail" class="mail"/>
                    </div>

                    <div class="form-actions">
                        <div class="pull-left">
                            <a href="javascript:;" class="save">保存</a>
                            <a href="javascript:;" class="cancel">取消</a>

                        </div>


                    </div>
                </div>
                </form>
			</div>		
		</div>
	</div>
	<!--内容结束-->
	
	

	

	
	

	<!--公共底部-->
	 	<!--公共底部-->
	<div id="foot-pic">
		<div id="gi">
			<span id="img">
			</span>
			<span id="text">
				OPPO社区
			</span>
		</div>
		
		<div id="gi1">
			<span id="img">
			</span>
			<span id="text">
				ColorOS
			</span>
		</div>
		
		<div id="gi2">
			<span id="img">
			</span>
			<span id="text">
				软件商店
			</span>
		</div>		
	</div>
	
	<div id="sitemap">
		<div class="wrapper">
			<div id="gi">
				<ul class="gi1">
					<span class="h_write">
						推荐机型
					</span>
					<ul class="gi2">
													<li><a href="http://localhost/opposhop/index.php?m=Home&c=Goods&a=index&gid=16">R9Plus金 大屏续航旗舰</a></li>
													<li><a href="http://localhost/opposhop/index.php?m=Home&c=Goods&a=index&gid=21">R9金 1600W前置自拍</a></li>
													<li><a href="http://localhost/opposhop/index.php?m=Home&c=Goods&a=index&gid=18"> A37玫瑰金 美颜4.0</a></li>
													<li><a href="http://localhost/opposhop/index.php?m=Home&c=Goods&a=index&gid=19">A59 闪速正面指纹识别</a></li>
											</ul>
				</ul>		
			</div>
			
			<div id="gi">
				<ul class="gi1">
					<span class="h_write">
						在线购买
					</span>

					<ul class="gi2">
											<li><a href="http://localhost/opposhop/index.php?m=Home&c=List&a=index&cid=1">手机</a></li>
										</ul>
				</ul>		
			</div>
			
			<div id="gi">
				<ul class="gi1">
					<span class="h_write">
						会员中心
					</span>
					<ul class="gi2">
						<li><a href="http://localhost/opposhop/index.php?m=Home&c=Login&a=index">会员登录</a></li>
						<li><a href="http://localhost/opposhop/index.php?m=Home&c=Login&a=zhuce">会员注册</a></li>
					</ul>
				</ul>		
			</div>		
		</div>
	</div>
	
	<div id="footer-tools">
		<div class="wrapper">
			<div class="h-wrapper">
				<span class="text">关注我们</span>
				<span class="icon">
					<img src="./Public/Home/images/weibo.png" style="width: 43px;height: 42px;"/>
				</span>
				<span class="icon1">
					<img src="./Public/Home/images/weixin.png" style="width: 43px;height: 42px;"/>
					<img class="img100" src="./Public/Home/images/erweima.png"/>										
				</span>
					<span class="text1">加入我们</span>
					<span class="text1">采购相关</span>				
			</div>
			
			<div class="h-subscribe">
				<span class="icon">
					<img src="./Public/Home/images/kefu.png"/>
				</span>
				<div class="about">
					<h4 class="h-delta">在线客服</h4>
					<p class="write">人工服务：8:30~22:00</p>
					<p class="write">24小时智能机器人服务</p>
					
				</div>	
				
				<span class="icon">
					<img src="./Public/Home/images/phone.png"/>
				</span>
				<div class="about">
					<h4 class="h-delta">4001-666-888</h4>
					<p class="write">7*24小时客服电话</p>
				</div>	
			</div>	
		</div>
	</div>
	<div id="bottom">
		<div class="center">
			<p class="bottom-info">© 2005 - 2016 东莞市永盛通信科技有限公司 | 版权所有 粤ICP备14056724号-2 | 联系方式：4001-666-888</p>
		</div>
	</div>
	

</body>
</html>